﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Add_Edit.aspx.cs" Inherits="admin_Module_Add_Edit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


   
    <script type="text/javascript">
        $(document).ready(function () {
            $("#uploadImage").colorbox({ width: "550px", inline: true, href: "#uploadImagePanel" });
            $("#uploadVideo").colorbox({ width: "550px", inline: true, href: "#uploadVideoPanel" });
            $("#uploadFile").colorbox({ width: "550px", inline: true, href: "#uploadFilePanel" });
        });

        function closeOverlay() {
            $.colorbox.close();
        }

        $(document).ready(function (e) {
            try {
                $("body select").msDropDown();
            } catch (e) {
                alert(e.message);
            }
        });
    </script>

    <div style="display:none;">
        <div id="uploadVideoPanel" class="overlaypanel">
            <h2>Chèn vidoe</h2>
            <ul class="fl" style="margin:0;">
                <li>
                    <asp:Label ID="lblVideoUpload" CssClass="lbl" AssociatedControlID="txtUploadVideo" runat="server" Text='Chèn video' />
                    <asp:FileUpload runat="server" ID="txtUploadVideo" Width="400" size="50" ValidationGroup="imageupload" />
                    <asp:RequiredFieldValidator ID="txtUploadVideoValidator" runat="Server" ControlToValidate="txtUploadVideo" ErrorMessage="*"
                        ValidationGroup="videoupload" />
                </li>
                <li style="margin:0;">
                    <asp:Button runat="server" ID="btnUploadVideo" Text="Tải lên"
                        ValidationGroup="videoupload" CssClass="btn primary" OnClientClick="colorboxDialogSubmitClicked('videoupload', 'uploadVideoPanel');" /> 
                        hoặc <a href="#" onclick="return closeOverlay();">Hủy</a>
                </li>
            </ul>
        </div>
        <div id="uploadImagePanel" class="overlaypanel">
            <h2>Ảnh đính kèm</h2>
            <ul class="fl" style="margin:0;">
                <li>
                    <label class="lbl">Tải ảnh</label>
                    <asp:FileUpload runat="server" ID="txtUploadImage" size="50" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="Server" ControlToValidate="txtUploadImage" ErrorMessage="*"
                        ValidationGroup="imageupload" />
                </li>
                <li style="margin:0;">
                    <asp:Button CssClass="btn primary" runat="server" ID="btnUploadImage" Text="Tải lên"
                        ValidationGroup="imageupload" OnClientClick="colorboxDialogSubmitClicked('imageupload', 'uploadImagePanel');" />
                        hoặc <a href="#" onclick="closeOverlay();">Hủy</a>
                </li>
            </ul>
        </div>
        <div id="uploadFilePanel" class="overlaypanel">
            <h2>File đính kèm</h2>
            <ul class="fl" style="margin:0;">
                <li>
                    <label class="lbl">Chèn file</label>
                    <asp:FileUpload runat="server" ID="txtUploadFile" size="50" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtUploadFile" ErrorMessage="*"
                        ValidationGroup="fileUpload" />
                </li>
                <li style="margin:0;">
                    <asp:Button CssClass="btn primary" runat="server" ID="btnUploadFile" Text="Tải lên"
                        ValidationGroup="fileUpload" OnClientClick="colorboxDialogSubmitClicked('fileUpload', 'uploadFilePanel');" />
                        hoặc <a href="#" onclick="closeOverlay();">Hủy</a>
                </li>
            </ul>
        </div>
    </div>

    <div class="content-box-outer">
        <div class="content-box-full">
            <h1>Thêm / Cập nhật trang</h1>
            <table class="tblForm largeForm" style="width:100%; margin:0;">
                <tr>
                    <td style="vertical-align:top; padding:0 40px 0 0;">
                        <ul class="fl">
                           
                            <li>
                                <label class="lbl" for="<%=txtTitle.ClientID %>">
                                    Tiêu đề</label>
                                <asp:TextBox runat="server" ID="txtTitle" Width="600"  />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle" Display="Dynamic"
                                    ErrorMessage="*" ValidationGroup="addPage"/>
                            </li>
                            <asp:TextBox ID="txtDataSource" runat="server" Width="600" ></asp:TextBox>
                            <li>
                                <div class="editToolbar">
                                    <a href="#" id="uploadImage" class="image">Chèn ảnh</a>
                                    <a href="#" id="uploadVideo" class="video">Chèn video</a>
                                    <a href="#" id="uploadFile" class="file">Chèn file</a>
                                </div>
                                <label class="lbl"> Cài đặt tham số</label>
                           <asp:Editor ID="txtBody" runat="server" Width="100%" Height="350" Mode="Basic" />
                            </li>
                           
                            
                           
                        </ul>
                    </td>
                    <td class="secondaryForm" style="padding:0; vertical-align:top;">
                        <ul class="fl">
                            <label class="lbl">Tên module</label>
                             <asp:DropDownList ID="ddlName" runat="server"  Width="250" AutoPostBack="true" OnSelectedIndexChanged="ddlName_SelectedIndexChanged">
                                <asp:ListItem Value="WIDGET_WEATHER">WIDGET_WEATHER</asp:ListItem>
                                <asp:ListItem Value="WIDGET_POLL">WIDGET_POLL</asp:ListItem>
                                <asp:ListItem Value="WIDGET_HTML">WIDGET_HTML</asp:ListItem>
                                <asp:ListItem Value="WIDGET_SHOPPINGCART">WIDGET_SHOPPINGCART</asp:ListItem>
                                <asp:ListItem Value="WIDGET_SEARCH">WIDGET_SEARCH</asp:ListItem>
                                <asp:ListItem Value="WIDGET_LOGIN">WIDGET_LOGIN</asp:ListItem>
                            </asp:DropDownList>
                           
                               


                              <label class="lbl">Kiểu Module</label>
                                <asp:DropDownList runat="server" ID="ddlType" Width="250" AppendDataBoundItems="true">
                                <asp:ListItem Value="WIDGET">WIDGET</asp:ListItem>
                                    <asp:ListItem Value="SLIDESHOW">SLIDESHOW</asp:ListItem>
                                    <asp:ListItem Value="CONTROL">CONTROL</asp:ListItem>
                                  
                                </asp:DropDownList>

                                <label class="lbl">Vị trí</label>
                                <asp:DropDownList runat="server" ID="ddPosition" Width="250" AppendDataBoundItems="true">
                                <asp:ListItem Value="TOP">TOP</asp:ListItem>
                                    <asp:ListItem Value="LEFT">LEFT</asp:ListItem>
                                    <asp:ListItem Value="RIGHT">RIGHT</asp:ListItem>
                                    <asp:ListItem Value="BOTTOM">BOTTOM</asp:ListItem>
                                    <asp:ListItem Value="LOGO">LOGO</asp:ListItem>
                                    <asp:ListItem Value="FOOTER">FOOTER</asp:ListItem>
                                    <asp:ListItem Value="SLIDESHOW">SLIDESHOW</asp:ListItem>
                                </asp:DropDownList>
                          
                         
                             <li>
                                <asp:CheckBox runat="Server" ID="cbPublished" Checked="true" Text="Cho phép hiển thị" />
                            </li>

                            <li>

                                <asp:TextBox ID="txtSortIndex" Width="250" runat="server"></asp:TextBox>
                            </li>
                        </ul>
                    </td>
                </tr>
            </table>

            <div class="action_buttons">
                <asp:Button ID="btnSave" Text="Lưu" 
                    CssClass="btn primary"  runat="server" onclick="btnSave_Click"  ValidationGroup="addPage"/>
                 hoặc
                
                <a href="Pages.aspx" title="Cancel">Hủy</a>
               
            </div>
        </div>
    </div>
</asp:Content>


